package org.example.panel;
import javax.swing.*;
import java.awt.event.*;
import org.example.frame.*;
import org.example.model.*;

/**
 * @author lenovo
 */

public class ReturnFramePanel extends JPanel {
    public ReturnFramePanel(User user,JFrame frame){
        //组件准备
        JButton returnFrame = new JButton("返回界面");
        //注册监视器
        returnFrame.addActionListener((ActionEvent e)->{
            new SecondFrame(user);
            frame.dispose();
        });
        //添加组件
        add(returnFrame);
    }
}
